Rigid

您所在的位置:网站首页 body simulator Rigid

Rigid

#Rigid| 来源: 网络整理| 查看: 265

Joints¶

Joints give you the ability to connect physics objects by defining how the objects may move relative to each other. For example, a revolute joint can be used to connect a wheel to a car’s chassis: It allows the wheel to rotate around a single axis.

Joints may create connections between all types of rigid objects, i.e. dynamic and kinematic rigid bodies, static colliders, and also Articulations (i.e. their rigid-body links in particular). It is also possible to connect objects to the static world coordinate frame if you leave one of the joint’s Body relationships empty (which is then implicitly relating to the world frame).

In the overview table about joint types, you also find information about what joints can be simulated natively by Articulations and are compatible with, i.e. can create connections to articulation links.

Debug Visualization of the joints not only displays the joints and their frames, but allows authoring of the joint frames as well - just enable Joints in the Debug Visualization viewport options.

For joints tutorial please watch this video: Rigging a Desk Lamp

Types

Explore the different joint motions with the Physics Demo Snippets that are available for each of the joint types.

Type

Description

Articulations native compatible

The revolute joint allows rotation about a single axis.

yes yes

The prismatic joint allows linear motion along a single axis.

yes yes

The spherical joint allows rotation about three axes, i.e. a ball-in-socket-type joint.

yes yes

The D6 joint can be configured to allow between zero and six degrees of relative motion, i.e. up to three linear plus three rotational motions. Use Joint Limits to lock individual axes. Articulations can natively simulate D6 joints with 1-3 unlocked rotational motions (all linear motion must be locked).

(yes) yes

The fixed joint allows no relative motion. It is particularly useful when building fixed-base Articulations.

yes yes

The distance joint allows any relative motion but limits how far apart the connected rigid bodies may be (in particular their joint frames).

no yes

The gear joint couples the rotations of two revolute joints by a gear ratio. See the snippet and its Python code for details.

no yes

The rack-and-pinion joint couples the rotation of a revolute joint to the travel of a prismatic joint by a gear ratio (rotation/distance). See the snippet and its Python code for details.

no yes

Joint Frames

Each of the two physics objects that are connected by a joint has an associated joint frame. The joint frame is fixed and positioned in the body’s local frame using the Local Position 0/1 and Local Rotation 0/1 properties.

Any joint motion is relative to the bodies’ configuration where the two joint frames are aligned: For example, a revolute joint configured to rotate around the x-axis allows rotation of the two body frames about their shared x axis, and at zero joint angle, the two frames are aligned. An offset is illustrated in the following revolute joint example:

The revolute joint connects the red and blue geometries that are configured as a static collider (red) and dynamic rigid body (blue) respectively. Let us focus on the Local Rotations first. The Local Rotation 0 for box0 is thirty degrees around x which is reflected in the joint-frame visualization. As soon as the simulation is started, the blue box will rotate up to align its frame (that is not rotated). The thirty degree Joint Limit is relative to the aligned frames as well (see the see red lines and arc visualization).

In the same example, you will notice the different values used to define the (y) local positions of the frames: 0.6 and -60.0. The reason is that joint positions scale together with a body. In the example, the red box0 is created from a unit-cube with side-length 1.0 which is then scaled by 10.0, 100.0, 10.0 in x, y, and z, respectively. The blue box1 is created from a cube with side-length 100.0 which is scaled by 0.1, 1.0, 0.1 in x, y, and z, respectively. Therefore, both geometries have the same world dimensions, but their different scaling results in the joint frames being correctly positioned by the 0.6 (times 100.0) and -60 in y, respectively.

Joint Limits

Some joints provide limit properties directly in their corresponding rollout, so you can configure ranges for the relative motion that the joints allow (e.g. thirty degrees rotation in the revolute joint example above).

For the D6 joints, you can add limit components in order to lock or limit specific axes with Add > Physics > Limit in the D6’s property window. In order to lock an axis, set the lower limit to above the high limit. See the D6 Joint snippet in the demo scenes as well.

Note

Due to differences in the underlying PhysX implementation, spherical joint limits are pyramidal in native articulation joints, and conical for regular spherical joints.

Revolute joints with limits are simulated using PhysX SDK unwrapped revolute joints, which enables setting drive targets and joint limits outside the regular revolute joint angle wrap at +/- 2pi. The revolute joint type is determined at simulation start, and enabling/disabling limits later on cannot change the type.

Joint Drives

Many joints support adding drives so you can physically actuate a mechanism (vs. kinematic animation). For example, you can add a drive to a revolute joint that connects a wheel to a car to make it move. Add the drive with Add > Physics > (type) Drive where the type will be context-sensitive and describing the motion of the drive (e.g. angular for a revolute joint).

Drives apply a force to the joint to maintain a position and/or a velocity that is proportional to

stiffness * (position - target_position) + damping * (velocity - target_velocity)

so the stiffer you configure the drive, the harder it will push the bodies to satisfy a given target position for the drive. Damping is analogous for the joint velocity, and you can implement a velocity drive by setting stiffness to zero.

Note

Spherical joints currently do not support drives, but you may configure a D6 joint with drives to get the same driven motion, including native simulation support in articulations.

RigidBody xformOp reset and sanitation

Simulation output cant write to arbitrary xformOp order stack. Therefore we do sanitation of the xformOp stack to work with simulation.

These steps happen when play is pressed:

RigidBody xformOp stack is stored with xformOp attributes and values

If the xformOp stack is translate, orient, scale nothing happens, if other stack is found its cleared and replaced by translate, orient, scale stack.

Simulation writes output into translate and orient (quaternion).

When simulation ends, xformOp stack is replaced with the stored xformOp attributes from simulation start.



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3